import request from '@/utils/request'

export default {
    getList() {
        return request({
            url: 'http://localhost:7788/category/list',
            method: 'get',
        })
    },
    up(img){
        return request({
            url: 'http://localhost:7788/category/up',
            method: 'post',
            data:img
        })
    },
    //
    edit(category){
        return request({
            url: 'http://localhost:7788/category/edit',
            method: 'post',
            data:category
        }) 
    },
    getById(id){
        return request({
            url: `http://localhost:7788/category/getById?id=${id}`,
            method: 'get',
        }) 
    },
    add(category){
        return request({
            url: 'http://localhost:7788/category/add',
            method: 'post',
            data:category
        }) 
    },
    count(id){
        return request({
            url: `http://localhost:7788/category/count?id=${id}`,
            method: 'get',
        }) 
    },
    delete(id){
        return request({
            url: `http://localhost:7788/category/delete?id=${id}`,
            method: 'get',
        }) 
    },
    deleteRelation(id){
        return request({
            url: `http://localhost:7788/category/deleteRelation?id=${id}`,
            method: 'get',
        }) 
    },
}
